package cn.buk.tms.entity.misc;

import com.fasterxml.jackson.annotation.JsonFormat;

import jakarta.persistence.*;
import java.util.Date;

/**
 * 客户服务分组：
 * 将企业客户（包含企业散客）分为不同的组，比如客户A组、B组；
 * 对应的将客服也分为客服A组、B组，
 * 客服只能处理相匹配的客户的名单
 * @author yfdai
 */
@Entity
@Table(name = "sys_group_customer_service",
        uniqueConstraints = @UniqueConstraint(
                name = "uk_group_customer_service",
                columnNames = {"enterprise_id", "group_code"}))
public class GroupCustomerService {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @Column(name = "enterprise_id", nullable = false)
    private int enterpriseId;

    /**
     * 组代码：A、B等
     */
    @Column(name = "group_code", length = 5, nullable = false, updatable = false)
    private String groupCode;

    /**
     * 组名称：客服A组、客服B组
     */
    @Column(name = "group_name", length = 50, nullable = false)
    private String groupName;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "create_time", insertable = false, updatable = false)
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "last_update", insertable = false)
    private Date lastUpdate;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getEnterpriseId() {
        return enterpriseId;
    }

    public void setEnterpriseId(int enterpriseId) {
        this.enterpriseId = enterpriseId;
    }

    public String getGroupCode() {
        return groupCode;
    }

    public void setGroupCode(String groupCode) {
        this.groupCode = groupCode;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getLastUpdate() {
        return lastUpdate;
    }

    public void setLastUpdate(Date lastUpdate) {
        this.lastUpdate = lastUpdate;
    }
}
